International aid may take the form of multilateral aid – provided through international bodies such as the UN, or NGOs such as Oxfam – or bilateral aid, which operates on a government-to-government basis. There is considerable debate about whether international aid works, in the sense of reducing poverty and stimulating development.
However, the effectiveness of aid is often diluted by corruption. Aid is invariably channeled through the governments of recipient countries, in which power is often concentrated in the hands of a few politicians and bureaucrats, and the mechanisms of accountability are, at best, poorly developed. This tends to benefit corrupt leaders and elites rather than the people, projects and programs for which it was intended.
The hypothesis that foreign aid can promote growth in developing countries was explored, using panel data series for foreign aid, while accounting for regional differences in Asian, African, Latin American, and the Caribbean countries as well as the differences in income levels, the results of this study also indicate that foreign aid has mixed effects on economic growth in developing countries.
This study examines the relationships between foreign aid, institutional structure, and economic performance for 80 countries in Europe, America, Africa, and Asia. It is found that official development assistance and the quality of institutional structure in the sample countries affect economic growth positively.
Algunas librerias y paquetes usados para obtener y descargar los datos
library(tidyverse) # manejo de dataframes
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4
## ✓ tibble 3.1.2 ✓ dplyr 1.0.7
## ✓ tidyr 1.1.3 ✓ stringr 1.4.0
## ✓ readr 2.0.1 ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(WDI) # libreria para acceder a metadata de banco mundial
library(readxl) # leer archivos de excel
library(readr) # leer archivos csv
library(visdat) # visualizacion de datos como graficos
library(plotly) # graficos
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(purrr) # funcion map
library(plm) # modelos lineales para datos panel
##
## Attaching package: 'plm'
## The following objects are masked from 'package:dplyr':
##
## between, lag, lead
Datos para paises bajos ingresos sean utilizados, segun clasificación del banco mundial, hay 26 paises de bajos ingresos y 51 de ingresos medios bajos
country_class <- read_excel("CLASS.xlsx")
country_class %>%
filter(!is.na(Region), !is.na(`Income group`)) %>%
group_by(`Income group`) %>%
summarise(countries = n())
Listado de paises a analisar:
my_countries <- country_class %>%
filter(!is.na(Region), `Income group` %in% c('Low income', 'Lower middle income')) %>%
select(Code)
my_countries
Hacer la respectiva asociacion de nombres iso3c e iso2c
my_countries$iso2c <- WDI_data$country %>%
filter(iso3c %in% my_countries$Code) %>%
.$iso2c
my_countries
Datos del banco mundial (para ODA y los indices de gobernanza) y el Human Development Reports API son descargados desde scripts de Python. Son almacenados en archivos CSV y luego son cargados aqui:
datos_HDI <- read_csv("datos_python_HDI.csv", col_names = c('Code', 'iso2c', 'indicator', 'year', 'value'),
col_types = list(col_character(), col_character(), col_character(), col_double(), col_double()))
hdi_indicators <- datos_HDI %>% distinct(indicator) %>% .$indicator
oda_indicators <- c(
'DT_ODA_ALLD_CD',
'DT_ODA_ALLD_KD',
'DT_ODA_OATL_CD',
'DT_ODA_OATL_KD',
'DT_ODA_ODAT_CD',
'DT_ODA_ODAT_GI_ZS',
'DT_ODA_ODAT_GN_ZS',
'DT_ODA_ODAT_KD',
'DT_ODA_ODAT_MP_ZS',
'DT_ODA_ODAT_PC_ZS',
'DT_ODA_ODAT_XP_ZS'
)
gob_indicators <- c(
'CC_EST',
'CC_NO_SRC',
'CC_PER_RNK',
'CC_PER_RNK_LOWER',
'CC_PER_RNK_UPPER',
'CC_STD_ERR',
'GE_EST',
'GE_NO_SRC',
'GE_PER_RNK',
'GE_PER_RNK_LOWER',
'GE_PER_RNK_UPPER',
'GE_STD_ERR',
'PV_EST',
'PV_NO_SRC',
'PV_PER_RNK',
'PV_PER_RNK_LOWER',
'PV_PER_RNK_UPPER',
'PV_STD_ERR',
'RQ_EST',
'RQ_NO_SRC',
'RQ_PER_RNK',
'RQ_PER_RNK_LOWER',
'RQ_PER_RNK_UPPER',
'RQ_STD_ERR',
'RL_EST',
'RL_NO_SRC',
'RL_PER_RNK',
'RL_PER_RNK_LOWER',
'RL_PER_RNK_UPPER',
'RL_STD_ERR',
'VA_EST',
'VA_NO_SRC',
'VA_PER_RNK',
'VA_PER_RNK_LOWER',
'VA_PER_RNK_UPPER',
'VA_STD_ERR'
)
gdp_indicators <- c(
'NY_ADJ_NNTY_PC_CD',
'NY_ADJ_NNTY_PC_KD',
'NY_ADJ_NNTY_PC_KD_ZG',
'NY_GDP_PCAP_CN',
'NY_GDP_PCAP_KN',
'NY_GDP_PCAP_CD',
'NY_GDP_PCAP_KD',
'NY_GDP_MKTP_KD_ZG',
'NY_GDP_DEFL_ZS_AD',
'NY_GDP_DEFL_ZS',
'NY_GDP_MKTP_CD',
'NY_GDP_MKTP_CN',
'NY_GDP_MKTP_KN',
'NY_GDP_MKTP_KD',
'NY_GDP_PCAP_KD_ZG',
'NY_GDP_PCAP_PP_KD',
'NY_GDP_PCAP_PP_CD',
'SL_GDP_PCAP_EM_KD',
'SP_POP_GROW'
)
datos_WB <- data.frame(indicator = character(), iso2c = character(), year = double(), value = double())
suppressWarnings(
for (indicator in c(oda_indicators, gob_indicators, gdp_indicators)) {
datos_WB <- rbind(datos_WB, read_csv(paste("datos_python", indicator, ".csv", sep =''),
col_names = c('indicator', 'iso2c', 'year', 'value'),
col_types = list(col_character(), col_character(), col_double(), col_double())))
}
)
Transformar la estructura de los datos para una mejor comprension
datos_paper <- rbind(datos_WB, datos_HDI %>% select(indicator, iso2c, year, value)) %>%
pivot_wider(names_from = indicator, values_from = value)
Revisar que datos estan como faltantes
vis_dat(datos_paper %>% select(all_of(gsub("_", ".", oda_indicators))))
# DT.ODA.OATL.CD and DT.ODA.OATL.KD faltan
# DT.ODA.ODAT.GI.ZS, DT.ODA.ODAT.GN.ZS, DT.ODA.ODAT.MP.ZS and DT.ODA.ODAT.XP.ZS tienen faltas
# Un par de ocurrencias pais-año que faltan datos
vis_dat(datos_paper %>% select(NY.GDP.PCAP.CN, NY.GDP.PCAP.CD))
# NY.GDP.PCAP.CN, NY.GDP.PCAP.CD, NY.GDP.MKTP.CD, NY.GDP.MKTP.CN son buenos candidatos,
# 'SY'falta PIB per Capita en 2022, 2023 sin datos algunos paises
vis_dat(datos_paper %>% arrange(year) %>% select(all_of(gsub("_", ".", gob_indicators))))
# Datos del 2000 para atras tienen espacios faltantes
vis_dat(datos_paper %>% select(all_of(hdi_indicators)))
# abr, co2_prod, le, le_f, le_m, mmr son las pocas categorias sin datos faltantes
vis_dat(datos_paper %>% arrange(year) %>% select(hdi))
# hdi faltante en multiples ocaciones
vis_dat(datos_paper %>% arrange(iso2c) %>% select(SP.POP.GROW))
# ZW no tiene datos de crecimiento poblacional
Tomando en cuenta los datos faltantes, hacer filtros para seleccionar una muestra mas pequeña
# 2023 aun no tiene registro en ODA
datos_paper %>% filter(is.na(DT.ODA.ALLD.CD), !year %in% c(2023)) ## SS (South Sudan) y ZW (Zimbabwe) faltantes de ODA y GOB indicators
datos_paper %>% filter(!iso2c %in% c('SS', 'ZW')) %>% filter(is.na(CC.EST)) %>% group_by(year) %>% summarise(times = n())
# para años 1995, 1997, 1999, 2001 y 2023 no hay registros de GOB
# 1996, 1998, 2000, 2002 and 2003 tiene algunos paises sin datos
datos_paper %>% arrange(year) %>% filter(!iso2c %in% c('SS', 'ZW'), !year %in% c(1995, 1997, 1999, 2001, 2023)) %>%
filter(is.na(CC.EST)) # FM (Micronesia), KI (Kiribati) y TL (Timor-Leste) no tiene GOB in en estos años
# tambien CV (Cabo Verde) and SB (Solomon Islands) no registro GOB en 2000 - 2003
datos_paper %>% arrange(iso2c) %>%
filter(!iso2c %in% c('SS','ZW','BT','ER','GW','KP','LB','NG','PS','SO','VU','FM','KI','TL','CB','CV','SB'),
!year %in% c(1995, 1996, 1997, 1998, 1999, 2000, 2001, 2023)) %>%
select(iso2c, year, hdi,
all_of(gsub("_", ".", gob_indicators))
)
# Ver datos aplicando los filtros determinados en las busquedas pasadas
# antes del 2001 suele tener informacion faltante
# BT (Bhutan), ER (Eritrea), GW (Guinea-Bissau), KP (North Korea), LB (Lebanon), NG (Nigeria), PS (Palestine), SO (Somalia), VU (Vanuatu) son paises # sin registro de hdi
datos_paper %>%
filter(!iso2c %in% c('SS', 'ZW', 'BT', 'ER', 'GW', 'KP', 'LB', 'NG', 'PS', 'SO', 'VU', 'FM', 'KI', 'TL', 'CV', 'SB','SY'),
!year %in% c(1995, 1996, 1997, 1998, 1999, 2000, 2023)) %>%
select(iso2c, year, hdi, DT.ODA.ALLD.CD, DT.ODA.ALLD.KD, DT.ODA.ODAT.CD, DT.ODA.ODAT.KD, DT.ODA.ODAT.PC.ZS,
NY.GDP.PCAP.CN, NY.GDP.PCAP.CD, SP.POP.GROW, all_of(gsub("_", ".", gob_indicators)),
) %>%
filter(is.na(CC.EST))
datos_paper %>%
filter(!iso2c %in% c('SS', 'ZW', 'BT', 'ER', 'GW', 'KP', 'LB', 'NG', 'PS', 'SO', 'VU', 'FM', 'KI', 'TL', 'CV', 'SB','SY'),
!year %in% c(1995, 1996, 1997, 1998, 1999, 2000, 2023)) %>%
select(iso2c, year, hdi, DT.ODA.ALLD.CD, DT.ODA.ALLD.KD, DT.ODA.ODAT.CD, DT.ODA.ODAT.KD, DT.ODA.ODAT.PC.ZS,
NY.GDP.PCAP.CN, NY.GDP.PCAP.CD, SP.POP.GROW, all_of(gsub("_", ".", gob_indicators)),
)
vis_dat(datos_paper %>%
filter(!iso2c %in% c('SS', 'ZW', 'BT', 'ER', 'GW', 'KP', 'LB', 'NG', 'PS', 'SO', 'VU', 'FM', 'KI', 'TL', 'CV', 'SB','SY'),
!year %in% c(1995, 1996, 1997, 1998, 1999, 2000, 2023)) %>%
select(iso2c, year, hdi, DT.ODA.ALLD.CD, DT.ODA.ALLD.KD, DT.ODA.ODAT.CD, DT.ODA.ODAT.KD, DT.ODA.ODAT.PC.ZS,
NY.GDP.PCAP.CN, NY.GDP.PCAP.CD, SP.POP.GROW, all_of(gsub("_", ".", gob_indicators)),
))
vis_dat(datos_paper %>%
filter(!iso2c %in% c('SS', 'ZW', 'BT', 'ER', 'GW', 'KP', 'LB', 'NG', 'PS', 'SO', 'VU', 'FM', 'KI', 'TL', 'CV', 'SB','SY'),
!year %in% c(1995, 1996, 1997, 1998, 1999, 2000, 2001, 2023)) %>%
select(iso2c, year, hdi, DT.ODA.ALLD.CD, DT.ODA.ALLD.KD, DT.ODA.ODAT.CD, DT.ODA.ODAT.KD, DT.ODA.ODAT.PC.ZS,
NY.GDP.PCAP.CN, NY.GDP.PCAP.CD, SP.POP.GROW, all_of(gsub("_", ".", gob_indicators)),
))
De 2232 observaciones reducimos a 1098 (2002 hasta 2019) o a 1260 (2002
hasta 2022)
Aplicar Operador diferencia
datos_model <- datos_paper %>%
filter(!iso2c %in% c('SS', 'ZW', 'BT', 'ER', 'GW', 'KP', 'LB', 'NG', 'PS', 'SO', 'VU', 'FM', 'KI', 'TL', 'CV', 'SB', 'SY'),
!year %in% c(1995, 1996, 1997, 1998, 1999, 2000, 2023)) %>%
select(iso2c, year, hdi, DT.ODA.ALLD.CD, DT.ODA.ALLD.KD, DT.ODA.ODAT.CD, DT.ODA.ODAT.KD, DT.ODA.ODAT.PC.ZS,
NY.GDP.PCAP.CN, NY.GDP.PCAP.CD, SP.POP.GROW, all_of(gsub("_", ".", gob_indicators))
)
datos_model <- datos_model %>% arrange(iso2c, year) %>%
mutate(hdi_diff = hdi - lag(hdi),
NY.GDP.PCAP.CN_diff = NY.GDP.PCAP.CN - lag(NY.GDP.PCAP.CN),
NY.GDP.PCAP.CD_diff = NY.GDP.PCAP.CD - lag(NY.GDP.PCAP.CD),
DT.ODA.ALLD.CD_diff = DT.ODA.ALLD.CD - lag(DT.ODA.ALLD.CD),
DT.ODA.ODAT.PC.ZS_diff = DT.ODA.ODAT.PC.ZS - lag(DT.ODA.ODAT.PC.ZS)) %>%
filter(!year %in% c(2001))
vis_dat(datos_model)
Probando modelos sencillos, regresion lineal, Minimos cuadrados, datos panel, HDI o GDP o sus differecias
summary(lm(hdi ~ DT.ODA.ALLD.CD + CC.EST + GE.EST + PV.EST + RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data=datos_model))
##
## Call:
## lm(formula = hdi ~ DT.ODA.ALLD.CD + CC.EST + GE.EST + PV.EST +
## RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data = datos_model)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.24376 -0.05200 -0.00272 0.05310 0.48585
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.624e-01 6.715e-03 98.642 < 2e-16 ***
## DT.ODA.ALLD.CD 6.180e-12 2.369e-12 2.609 0.009195 **
## CC.EST -7.398e-02 9.048e-03 -8.176 7.13e-16 ***
## GE.EST 1.115e-01 9.458e-03 11.790 < 2e-16 ***
## PV.EST 1.501e-02 3.885e-03 3.864 0.000117 ***
## RQ.EST -6.752e-04 9.569e-03 -0.071 0.943761
## RL.EST 2.889e-02 1.046e-02 2.762 0.005834 **
## VA.EST -1.363e-02 4.712e-03 -2.892 0.003895 **
## SP.POP.GROW -3.803e-02 2.400e-03 -15.849 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.08028 on 1251 degrees of freedom
## Multiple R-squared: 0.427, Adjusted R-squared: 0.4234
## F-statistic: 116.6 on 8 and 1251 DF, p-value: < 2.2e-16
# Todas las variables son significativas al 99% excepto Regulatory Quality
summary(lm(hdi ~ DT.ODA.ODAT.PC.ZS + CC.EST + GE.EST + PV.EST + RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data=datos_model))
##
## Call:
## lm(formula = hdi ~ DT.ODA.ODAT.PC.ZS + CC.EST + GE.EST + PV.EST +
## RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data = datos_model)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.23281 -0.05385 -0.00335 0.05343 0.43779
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.449e-01 7.101e-03 90.823 < 2e-16 ***
## DT.ODA.ODAT.PC.ZS 2.411e-04 3.386e-05 7.120 1.81e-12 ***
## CC.EST -9.071e-02 9.130e-03 -9.935 < 2e-16 ***
## GE.EST 1.205e-01 9.294e-03 12.968 < 2e-16 ***
## PV.EST 6.662e-03 3.532e-03 1.886 0.059520 .
## RQ.EST 8.239e-03 9.499e-03 0.867 0.385940
## RL.EST 2.907e-02 1.017e-02 2.857 0.004342 **
## VA.EST -1.744e-02 4.658e-03 -3.745 0.000189 ***
## SP.POP.GROW -3.805e-02 2.344e-03 -16.231 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.07891 on 1251 degrees of freedom
## Multiple R-squared: 0.4464, Adjusted R-squared: 0.4428
## F-statistic: 126.1 on 8 and 1251 DF, p-value: < 2.2e-16
# Todas las variables son significativas al 99% excepto Regulatory Quality
summary(lm(NY.GDP.PCAP.CD ~ DT.ODA.ALLD.CD + CC.EST + GE.EST + PV.EST + RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data=datos_model))
##
## Call:
## lm(formula = NY.GDP.PCAP.CD ~ DT.ODA.ALLD.CD + CC.EST + GE.EST +
## PV.EST + RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data = datos_model)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2084.8 -611.6 -147.7 441.7 4237.9
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.461e+03 7.400e+01 33.256 < 2e-16 ***
## DT.ODA.ALLD.CD 4.006e-09 2.611e-08 0.153 0.878095
## CC.EST -9.011e+01 9.972e+01 -0.904 0.366385
## GE.EST 7.899e+02 1.042e+02 7.579 6.77e-14 ***
## PV.EST 1.556e+02 4.281e+01 3.634 0.000291 ***
## RQ.EST 9.097e+01 1.055e+02 0.863 0.388498
## RL.EST 1.399e+02 1.153e+02 1.214 0.225078
## VA.EST -2.908e+02 5.193e+01 -5.600 2.63e-08 ***
## SP.POP.GROW -2.049e+02 2.645e+01 -7.747 1.93e-14 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 884.7 on 1251 degrees of freedom
## Multiple R-squared: 0.286, Adjusted R-squared: 0.2814
## F-statistic: 62.63 on 8 and 1251 DF, p-value: < 2.2e-16
# Todas las variables son significativas al 99% excepto ODA.ALL, Control of Corruption, Regulatory Quality y Rule of Law
summary(lm(NY.GDP.PCAP.CD ~ DT.ODA.ODAT.PC.ZS + CC.EST + GE.EST + PV.EST + RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data=datos_model))
##
## Call:
## lm(formula = NY.GDP.PCAP.CD ~ DT.ODA.ODAT.PC.ZS + CC.EST + GE.EST +
## PV.EST + RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data = datos_model)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1876.5 -586.5 -166.4 364.0 4382.8
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2152.1327 76.8078 28.020 < 2e-16 ***
## DT.ODA.ODAT.PC.ZS 3.5326 0.3663 9.644 < 2e-16 ***
## CC.EST -314.1459 98.7580 -3.181 0.0015 **
## GE.EST 887.1625 100.5340 8.825 < 2e-16 ***
## PV.EST 91.4305 38.2095 2.393 0.0169 *
## RQ.EST 252.0015 102.7496 2.453 0.0143 *
## RL.EST 83.6278 110.0482 0.760 0.4474
## VA.EST -343.0970 50.3834 -6.810 1.51e-11 ***
## SP.POP.GROW -215.6641 25.3596 -8.504 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 853.6 on 1251 degrees of freedom
## Multiple R-squared: 0.3354, Adjusted R-squared: 0.3311
## F-statistic: 78.91 on 8 and 1251 DF, p-value: < 2.2e-16
# Todas las variables son significativas al 99% excepto Rule of Law
Se revisara las relaciones entre las variables graficamente
my_plot <- list()
for (col in c('DT.ODA.ALLD.CD', 'DT.ODA.ODAT.PC.ZS', 'DT.ODA.ALLD.CD_diff', 'DT.ODA.ODAT.PC.ZS_diff',
'CC.EST', 'GE.EST', 'PV.EST', 'RQ.EST', 'RL.EST', 'VA.EST')) {
my_plot[[col]] <- plot_ly(x = datos_model[[col]], y = datos_model[[3]], type = 'scatter', mode = 'markers', name = col)
}
subplot(my_plot[1:4], nrows = 2, margin = 0.05) %>% layout(title = 'HDI vs ODA')
subplot(my_plot[5:10], nrows = 2, margin = 0.05) %>% layout(title = 'HDI vs GOB')
my_plot <- list()
for (col in c('DT.ODA.ALLD.CD', 'DT.ODA.ODAT.PC.ZS', 'DT.ODA.ALLD.CD_diff', 'DT.ODA.ODAT.PC.ZS_diff',
'CC.EST', 'GE.EST', 'PV.EST', 'RQ.EST', 'RL.EST', 'VA.EST')) {
my_plot[[col]] <- plot_ly(x = datos_model[[col]], y = datos_model[[48]], type = 'scatter', mode = 'markers', name = col)
}
subplot(my_plot[1:4], nrows = 2, margin = 0.05) %>% layout(title = 'HDI diff vs ODA')
subplot(my_plot[5:10], nrows = 2, margin = 0.05) %>% layout(title = 'HDI diff vs GOB')
my_plot <- list()
for (col in c('DT.ODA.ALLD.CD', 'DT.ODA.ODAT.PC.ZS', 'DT.ODA.ALLD.CD_diff', 'DT.ODA.ODAT.PC.ZS_diff',
'CC.EST', 'GE.EST', 'PV.EST', 'RQ.EST', 'RL.EST', 'VA.EST')) {
my_plot[[col]] <- plot_ly(x = datos_model[[col]], y = datos_model[[10]], type = 'scatter', mode = 'markers', name = col)
}
subplot(my_plot[1:4], nrows = 2, margin = 0.05) %>% layout(title = 'GDP.PC vs ODA')
subplot(my_plot[5:10], nrows = 2, margin = 0.05) %>% layout(title = 'GDP.PC vs GOB')
my_plot <- list()
for (col in c('DT.ODA.ALLD.CD', 'DT.ODA.ODAT.PC.ZS', 'DT.ODA.ALLD.CD_diff', 'DT.ODA.ODAT.PC.ZS_diff',
'CC.EST', 'GE.EST', 'PV.EST', 'RQ.EST', 'RL.EST', 'VA.EST')) {
my_plot[[col]] <- plot_ly(x = datos_model[[col]], y = datos_model[[50]], type = 'scatter', mode = 'markers', name = col)
}
subplot(my_plot[1:4], nrows = 2, margin = 0.05) %>% layout(title = 'GDP.PC diff vs ODA')
subplot(my_plot[5:10], nrows = 2, margin = 0.05) %>% layout(title = 'GDP.PC diff vs GOB')
No se ve una relacion clara, hay tanto paises con punteos altos y bajos de GOB que tienen tanto HID altos o bajos Quiza puede verse una leve relacion de mayor punteo en GOB acompañado de mejor punteo den HDI Los datos de GPD si muestran una relacion positiva con el HDI visto en las graficas
Se realizara el mismo proceso con el crecimiento o decrecimiento de HDI anual (no se perderan datos al calcular la diferencia porque se añade el año 2001 en la seleccion)
Viendo la historia de las variables en el tiempo (por pais)
datos_model %>% filter(iso2c == 'AF') %>% plot_ly(x = ~year) %>%
add_trace(y = ~hdi, type = 'scatter', mode = 'lines+markers', name = 'hdi') %>%
add_trace(y = ~NY.GDP.PCAP.CD / 1000, type = 'scatter', mode = 'lines+markers', name = 'gdp.pc') %>%
add_trace(y = ~DT.ODA.ALLD.CD / 10000000000, type = 'scatter', mode = 'lines+markers', name = 'ODA.ALL') %>%
add_trace(y = ~DT.ODA.ODAT.PC.ZS / 1000, type = 'scatter', mode = 'lines+markers', name = 'ODA.PC') %>%
add_trace(y = ~CC.EST, type = 'scatter', mode = 'lines+markers', name = 'CC') %>%
add_trace(y = ~GE.EST, type = 'scatter', mode = 'lines+markers', name = 'GE') %>%
add_trace(y = ~PV.EST, type = 'scatter', mode = 'lines+markers', name = 'PV') %>%
add_trace(y = ~RQ.EST, type = 'scatter', mode = 'lines+markers', name = 'RQ') %>%
add_trace(y = ~RL.EST, type = 'scatter', mode = 'lines+markers', name = 'RL') %>%
add_trace(y = ~VA.EST, type = 'scatter', mode = 'lines+markers', name = 'VA')
summary(lm(hdi ~ DT.ODA.ALLD.CD + CC.EST + GE.EST + PV.EST + RQ.EST + RL.EST + VA.EST + SP.POP.GROW + iso2c, data=datos_model))
##
## Call:
## lm(formula = hdi ~ DT.ODA.ALLD.CD + CC.EST + GE.EST + PV.EST +
## RQ.EST + RL.EST + VA.EST + SP.POP.GROW + iso2c, data = datos_model)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.142667 -0.023725 0.003785 0.024445 0.095473
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.622e-01 1.632e-02 28.319 < 2e-16 ***
## DT.ODA.ALLD.CD 2.089e-11 1.533e-12 13.623 < 2e-16 ***
## CC.EST -8.331e-03 6.874e-03 -1.212 0.225736
## GE.EST 7.539e-03 6.801e-03 1.108 0.267883
## PV.EST -4.462e-03 2.915e-03 -1.531 0.126074
## RQ.EST 2.094e-02 6.706e-03 3.122 0.001838 **
## RL.EST 3.256e-02 7.769e-03 4.191 2.99e-05 ***
## VA.EST 6.926e-03 5.106e-03 1.356 0.175199
## SP.POP.GROW -5.590e-03 1.881e-03 -2.972 0.003014 **
## iso2cAO 1.452e-01 1.323e-02 10.971 < 2e-16 ***
## iso2cBD 1.144e-01 1.316e-02 8.694 < 2e-16 ***
## iso2cBF -5.751e-02 1.452e-02 -3.962 7.88e-05 ***
## iso2cBI 2.206e-03 1.263e-02 0.175 0.861349
## iso2cBJ 5.345e-02 1.480e-02 3.611 0.000318 ***
## iso2cBO 2.491e-01 1.447e-02 17.214 < 2e-16 ***
## iso2cCD 1.970e-02 1.126e-02 1.749 0.080562 .
## iso2cCF -2.202e-02 1.323e-02 -1.664 0.096280 .
## iso2cCG 1.933e-01 1.344e-02 14.391 < 2e-16 ***
## iso2cCI 6.188e-02 1.302e-02 4.753 2.25e-06 ***
## iso2cCM 1.141e-01 1.282e-02 8.897 < 2e-16 ***
## iso2cDJ 3.787e-02 1.506e-02 2.514 0.012073 *
## iso2cEG 2.057e-01 1.464e-02 14.055 < 2e-16 ***
## iso2cET -5.384e-02 1.320e-02 -4.078 4.85e-05 ***
## iso2cGH 9.150e-02 1.588e-02 5.763 1.05e-08 ***
## iso2cGM 3.844e-02 1.516e-02 2.535 0.011357 *
## iso2cGN 3.450e-02 1.299e-02 2.657 0.008001 **
## iso2cHN 1.750e-01 1.409e-02 12.418 < 2e-16 ***
## iso2cHT 1.254e-01 1.387e-02 9.037 < 2e-16 ***
## iso2cIN 8.076e-02 1.609e-02 5.019 5.99e-07 ***
## iso2cJO 2.433e-01 1.685e-02 14.440 < 2e-16 ***
## iso2cKE 8.970e-02 1.338e-02 6.702 3.17e-11 ***
## iso2cKG 2.505e-01 1.410e-02 17.770 < 2e-16 ***
## iso2cKH 1.271e-01 1.428e-02 8.900 < 2e-16 ***
## iso2cKM 1.514e-01 1.523e-02 9.942 < 2e-16 ***
## iso2cLA 1.675e-01 1.533e-02 10.928 < 2e-16 ***
## iso2cLK 2.759e-01 1.683e-02 16.389 < 2e-16 ***
## iso2cLR 6.486e-02 1.372e-02 4.727 2.55e-06 ***
## iso2cLS 4.852e-02 1.707e-02 2.842 0.004566 **
## iso2cMA 1.553e-01 1.552e-02 10.004 < 2e-16 ***
## iso2cMG 5.928e-02 1.414e-02 4.191 2.98e-05 ***
## iso2cML -4.627e-02 1.380e-02 -3.353 0.000825 ***
## iso2cMM 1.313e-01 1.426e-02 9.206 < 2e-16 ***
## iso2cMR 1.027e-01 1.405e-02 7.310 4.88e-13 ***
## iso2cMW 2.355e-02 1.489e-02 1.582 0.113913
## iso2cMZ -3.347e-02 1.331e-02 -2.514 0.012084 *
## iso2cNE -8.701e-02 1.347e-02 -6.459 1.53e-10 ***
## iso2cNI 1.961e-01 1.447e-02 13.554 < 2e-16 ***
## iso2cNP 1.054e-01 1.449e-02 7.277 6.17e-13 ***
## iso2cPG 9.099e-02 1.393e-02 6.532 9.58e-11 ***
## iso2cPH 2.229e-01 1.554e-02 14.346 < 2e-16 ***
## iso2cPK 4.254e-02 1.301e-02 3.270 0.001106 **
## iso2cRW 3.929e-02 1.670e-02 2.353 0.018786 *
## iso2cSD 8.421e-02 1.253e-02 6.722 2.77e-11 ***
## iso2cSL 1.377e-02 1.417e-02 0.972 0.331360
## iso2cSN 1.830e-02 1.522e-02 1.202 0.229580
## iso2cST 1.575e-01 1.640e-02 9.606 < 2e-16 ***
## iso2cSZ 1.063e-01 1.705e-02 6.234 6.31e-10 ***
## iso2cTD -1.773e-02 1.271e-02 -1.395 0.163297
## iso2cTG 8.637e-02 1.437e-02 6.011 2.45e-09 ***
## iso2cTJ 2.438e-01 1.354e-02 18.005 < 2e-16 ***
## iso2cTN 2.456e-01 1.679e-02 14.626 < 2e-16 ***
## iso2cTZ 2.165e-02 1.356e-02 1.597 0.110578
## iso2cUG 3.464e-02 1.395e-02 2.483 0.013151 *
## iso2cUZ 2.925e-01 1.448e-02 20.197 < 2e-16 ***
## iso2cVN 2.103e-01 1.596e-02 13.181 < 2e-16 ***
## iso2cWS 2.167e-01 2.069e-02 10.472 < 2e-16 ***
## iso2cYE 4.979e-02 1.205e-02 4.134 3.82e-05 ***
## iso2cZM 9.126e-02 1.459e-02 6.255 5.53e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.03469 on 1192 degrees of freedom
## Multiple R-squared: 0.898, Adjusted R-squared: 0.8923
## F-statistic: 156.7 on 67 and 1192 DF, p-value: < 2.2e-16
#plm(hdi ~ DT.ODA.ALLD.CD + CC.EST + GE.EST + PV.EST + RQ.EST + RL.EST + VA.EST + SP.POP.GROW, data=datos_model,
# index = c("iso2c", "year"), model = "within")